const fs = require('fs');
function testReadFile(filePath){
    return new Promise((resolve,reject)=>{
        fs.readFile(filePath,'utf-8',(err,data)=>{
            err?reject(err):resolve(data);
        })
    })
}
testReadFile('./files/a.txt').then((result)=>{
    console.log(result);
    return testReadFile('./files/a.txt');
}).then((result1)=>{
    console.log(result1);
    return testReadFile('./files/b.txt');
}).then((result2)=>{
    console.log(result2);
}).catch((err)=>{
    console.log(err);
    
})